﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace SnongPhoneShop.Models
{
    public class Item
    {
        public string ItemID { get; set; }
    }
    public class SelectMulti
    {
        public SelectMulti()
        {
            ListItem= new List<Item>();
        }
        public List<Item> ListItem { get; set; }
        public bool CheckBoxItemChage(Item itemcheck)
        {
            bool A = ListItem.Any(x => x.ItemID == itemcheck.ItemID);
            if (A)
            {
                var item = ListItem.Single(m => m.ItemID == itemcheck.ItemID);
                ListItem.Remove(item);
            }
            else
            {
                ListItem.Add(itemcheck);
            }
            return true;
        }
    }
}